import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', () => {
  const accessToken = ref('')
  const refreshToken = ref('')
  const userInfo = ref()
  const accessTokenTime = ref(0)

  return { accessToken, refreshToken, userInfo, accessTokenTime }
},
  // 持久化(本地存储)
  {
    persist: {
      key: 'user',
      storage: localStorage
    },
  },
)
